﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess;
using System.Data;

namespace DataAccessLayer.Visit
{
    public class VisitDataAccess
    {

        public static Guid GetProcedureOIDFromAccessionNumber(string accessionNumber)
        {
            GestorBD.Query = "SELECT P.OID_ " +
                             "FROM Procedure_ AS P INNER JOIN " +
                             "Order_ AS O ON P.OrderOID_ = O.OID_ " +
                             "WHERE (O.AccessionNumber_ = '"+accessionNumber+"') ";
            return Guid.Parse(GestorBD.EjecutarSentencia().Rows[0][0].ToString());
        }

        public static DataTable GetIndexOfReportPart(int version, Guid ReportOID)
        {
            GestorBD.Query = "SELECT Index_ FROM ReportPart_ WHERE Version_='"+version+"' and ReportOID_='"+ReportOID+"'";
            return GestorBD.EjecutarSentencia();
        }
    }
}
